/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pig.mt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.pig4cloud.pig.mt.form.WxQrCodeForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 公众号带参二维码
 *
 * @author JLM
 * @date 2021-03-05 11:45:09
 */
@Data
@TableName("wx_qr_code")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "公众号带参二维码")
public class WxQrCode extends Model<WxQrCode> {
private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty(value="ID")
    private String id;
    /**
     * appid
     */
    @ApiModelProperty(value="appid")
    private String appid;
    /**
     * 是否为临时二维码
     */
    @ApiModelProperty(value="是否为临时二维码")
    private Boolean isTemp;
    /**
     * 场景值ID
     */
    @ApiModelProperty(value="场景值ID")
    private String sceneStr;
    /**
     * 二维码ticket
     */
    @ApiModelProperty(value="二维码ticket")
    private String ticket;
    /**
     * 二维码图片解析后的地址
     */
    @ApiModelProperty(value="二维码图片解析后的地址")
    private String url;
    /**
     * 该二维码失效时间
     */
    @ApiModelProperty(value="该二维码失效时间")
    private Date expireTime;
    /**
     * 该二维码创建时间
     */
    @ApiModelProperty(value="该二维码创建时间")
    private Date createTime;

	public WxQrCode(WxQrCodeForm form, String appid) {
		this.appid = appid;
		this.isTemp = form.getIsTemp();
		this.sceneStr = form.getSceneStr();
		this.createTime = new Date();
	}
    }
